." TOPIC: ddh(1)
." AUTHOR: dd86k <dd@dax.moe>
."
." Please read man-pages(7) and groff_man(7) about the manual page format.
." If you're missing groff_man.7, install groff. Solid documentation.
."
.TH ddh 1 "September 2021" dd86k "User manual"
.SH NAME
ddh \(em Generic hasher

.SH SYNOPSIS
.SY ddh
.B  {list|ver|help|version|license}
.SY ddh
.B  alias
.OP options...
.B  {files|-}...
.YS

.SH DESCRIPTION
.B ddh
is a generic hasher. The main goal of this utility is to centralize
the various options into one package for multiple systems.

By default, the GNU-style checksums are used. You can use
.I --tag
to switch to the BSD-style checksums. This affects reading lists.

The default entry mode is File for being the best case scenario for
behaving better on zero-length files, network shares, and on most
operating systems. The Mmfile option is good for performance reasons.

.SH EXAMPLES

.TP
.BI ddh \ help
Shows help screen and exit.

.TP
.BI ddh \ version
Shows version screen and exit.

.TP
.BI ddh \ list
List supported checksum and hash algorithms and exit.

.TP
.BI ddh \ sha1
Use SHA-1 to read from the standard input file handle and digest a result.

.TP
.BI ddh\ sha1 \ essay.txt
Use SHA-1 to hash
.I essay.txt
.R .

.TP
.BI ddh\ sha256 \ src/*
Use SHA-256 to hash all files in the
.I src
folder.

.TP
.BI ddh\ md5 \ -Ms \ "*.{json,md}"
Use MD5 to hash all files in sub-directories
.RI ( -s )
that end with .json or .md using the memory-mapped file option
.RI ( -M )
using the embedded glob matcher.

.TP
.BI ddh\ sha256 \ -c\ list
Use SHA-256 to verify the integrity a list of files. This is similar to
.BR sha256sum\ -c\ list .

.SH ALIASES

Below is a list of supported checksum and hash algorithms.

." See tbl(1)




.TS
l l l.
Alias	Name	Tag
.T&
lB l l.
_
crc32	CRC-32	CRC32
crc64iso	CRC-64-ISO	CRC64ISO
crc64ecma	CRC-64-ECMA	CRC64ECMA
md5	MD5-128	MD5
ripemd160	RIPEMD-160	RIPEMD160
sha1	SHA-1-160	SHA1
sha224	SHA-2-224	SHA224
sha256	SHA-2-256	SHA256
sha384	SHA-2-384	SHA384
sha512	SHA-2-512	SHA512
sha3-224	SHA-3-224	SHA3_224
sha3-256	SHA-3-256	SHA3_256
sha3-384	SHA-3-384	SHA3_384
sha3-512	SHA-3-512	SHA3_512
shake128	SHAKE-128	SHAKE128
shake256	SHAKE-256	SHAKE256
.TE

.SH OPTIONS

Short options can be combined. Options that expect an additional argument
(i.e., the following argument) should not be combined, this includes
.I -c
and
.IR -a .

.SS Entry methods
.TS
l l.
Option	Description
.T&
lB l.
-a, --arg	Hash argument text as UTF-8.
-c, --check	Check hashes against a file.
-	Set input mode to stdin.
.TE

.SS File input modes
.TS
l l.
Option	Description
.T&
lB l.
_
-F, --file	Set input mode to file (default).
-b, --binary	File: Set read mode to binary (default).
-t, --text	File: Set read mode to text.
-M, --mmfile	Set input mode to memory-mapped file.
.TE

.SS Embedded globber engine
.TS
l l.
Option	Description
.T&
lB l.
_
--shallow	Same-level directory (default).
-s, --depth	Deepest directories first.
--breath	Sub directories first.
--follow	Follow symbolic links (default).
--nofollow	Do not follow symbolic links.
.TE

.SS Miscellaneous
.TS
l l.
Option	Description
.T&
lB l.
_
--tag	Create or read BSD-style checksums.
--	Stop parsing arguments.
.TE

.SH WARNINGS

None for the moment!

.SH NOTES

UNIX-like shells use their own globbing mechanism. To use the embedded
globbing mechanism, use '*' or \\*.

Release versions of this utility has the druntime GC command-line
interface disabled.

.SH AUTHOR
Written by dd86k
.MT dd@dax.moe
.ME .

.SH LICENSE

ddh is currently licensed under the public domain, and so is this document.